package com.iteaj.iboot.plugin.code.controller;

import com.baomidou.mybatisplus.generator.config.InjectionConfig;
import com.baomidou.mybatisplus.generator.config.po.TableInfo;
import com.iteaj.iboot.plugin.code.utils.LowCodeUtil;

import java.util.Map;

public class ExtraInjectionConfig extends InjectionConfig {

    @Override
    public void beforeOutputFile(TableInfo tableInfo, Map<String, Object> objectMap) {
        super.beforeOutputFile(tableInfo, objectMap);
        objectMap.put("moduleName", LowCodeUtil.getModuleName(tableInfo.getComment()));
        objectMap.put("serviceName", LowCodeUtil.firstLowerServiceName(tableInfo.getServiceName()));
    }
}
